<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
        <select id="selectId"></select>
        <script>
            let mydate=new Date();
            let myddy=mydate.getDay();//获取存储当前日期
            let selectDom=document.getElementById('selectId')
            let weekday=["星期日","星期一","星期二","星期三","星期四","星期五","星期六"];
            selectDom.innerHTML=''
            switch (myddy) {
                case 0:
                weekday=["星期一","星期二","星期三","星期四","星期五"];
                    break;
                case 1:
                weekday=["星期一","星期二","星期三","星期四","星期五"];
                break;
                case 2:
                weekday=["星期二","星期三","星期四","星期五"];
                break;
                case 3:
                weekday=["星期三","星期四","星期五"];
                break;
                case 4:
                weekday=["星期四","星期五"];
                break;
                case 5:
                weekday=["星期五"];
                break;
                case 6:
                weekday=["星期一","星期二","星期三","星期四","星期五"];
                break;
                default:
                break;
            }
            for (let i = 0; i < weekday.length; i++) {
                let html=selectDom.innerHTML
                let myDate=new Date();
                var milliseconds=myDate.getTime()+1000*60*60*24*i;
                var newMyDate = new Date(milliseconds);
                var year = newMyDate.getFullYear();//获取当前年
                var month = newMyDate.getMonth()+1;//获取当前月
                var day = newMyDate.getDate();//获取当前日
                selectDom.innerHTML=html+"<option value ="+weekday[i]+">"+year+'年'+month+'月'+day+'日'+"</option>"
            }
        </script>
</body>
</html>